1. Field of the Invention
The present invention relates to an optical apparatus equipped with a microcomputer having an unrewritable memory and a rewritable non-volatile memory.
2. Description of Related Art
Heretofore, cameras equipped with a one-chip microcomputer and arranged to perform a film transport control, an exposure control, a focus adjusting control and the like by using the microcomputer have been proposed. Generally, in such types of cameras, when the power source is turned on, a reset circuit cancels a reset state of the microcomputer so as to start executing a control program installed in the microcomputer.
Also, in recent years, cameras having a microcomputer containing therein a flash ROM (flash read-only memory), which is a rewritable non-volatile memory, have come into practical use. Accordingly, it has become possible to adapt the camera to a newly-developed accessory by modifying a control program after the production of the camera.
However, there is a problem that if, when a program is being written in the flash ROM, the contents of the flash ROM are destroyed due to some accidents, the camera would perform an abnormal operation.
Also, as disclosed in Japanese Laid-Open Patent Application No. Hei 8-320834, a method for preventing malfunction of a program written in the flash ROM has been proposed, in which correct check-sum values for the horizontal and vertical directions are beforehand stored in an EEPROM (electricaly erasable programmable read-only memory), a check-sum value of a program to be executed is calculated before an ordinary operation, and it is verified whether the calculated check-sum value coincides with the check-sum value stored in the EEPROM. However, since, in such a method, a program for calculating a check-sum value is written in the flash ROM, if the check-sum calculating program itself has any defect, not only cannot the check-sum value be calculated, but also malfunction cannot be prevented.